<?php $title = 'parqueadero'; ?>
<?php include('encabezado.php'); ?>

<body >
<?php include('menu.php'); ?>
<?php $precio = 'class="section"'; ?>
<?php include('izq_nav.php'); ?>
<?php //require('alert.php'); ?>
<link rel="stylesheet" href="componentes/noti/messi.min.css" />



<style type="text/css" media="print">
 
.testing  {display: none;}
nav {display: none;}
.alert {display:none;}
.content {display:none;}
 
</style>
<style type="text/css">

 section.content { margin-top: 5px; }
h1{ font-size:16px;
text-transform: uppercase;  }
h2{ font-size:14px;
text-transform: uppercase;  }
h3{ font-size:12px;
text-transform: uppercase;  }

input{ width:90%;}
#placa{  
text-transform: uppercase;  
} 
#placa_pago{  
text-transform: uppercase;  
} 
</style>
<?php date_default_timezone_set("America/Bogota"); ?>
<section class="content">

	<div class="widget-container">
    
    
    
    <section class="widget">
			<header>
				<span class="icon">&#128200;</span>
				<hgroup>
	    <h1>Cambio Precios vehiculos</h1>
        <h2>fecha</h2>
				</hgroup>
				
			</header>
			<div class="content">
				<div class="field-wrap">
				<form id="formulario" action="componentes/guarda_precio.php"   method="post" >
        <fieldset>
          <table align="center" border="1" >
            <tr>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td>
                </td>
            </tr>
            <tr>
              <td>ID:</td>
              <td><input tabindex="1" type="text" name="id_precio" id="id_precio" readonly  >
                </td>
            </tr>
            <tr>
              <td>Vehiculo:</td>
              <td>
                <select   id="vehiculo" name="vehiculo"  style="width:200px;" onChange="enviando(this.value);" >
                  <option value=""></option>
                  <option value="moto">moto</option>
                  <option value="carro">carro</option>
                </select>
                <p>&nbsp;</p></td>
            </tr>
            <tr>
              <td>Precio</td>
              <td><input type="number" name="precio_hora" id="precio_hora"    >
                </td>
            </tr>
            <tr>
              
              <td><button type="submit" class="green" name="enviar" value="Enviar" >Ingresar</button></td>
            </tr>
          </table>
        </fieldset>
      </form>
				</div>
				
			</div>
		</section>
    

        


	

</div>
  </section>
<div id="loading"></div>
<div id="result"></div>
<div id="resultado"></div>
<!--<script type="text/javascript" src="componentes/jeasy/jquery.min.js"></script> 
<script type="text/javascript" src="componentes/jeasy/jquery.easyui.min.js"></script>  --->

<script src="componentes/js/jquery10.2.js" ></script>
<script src="componentes/noti/messi.js"></script>




<script language="javascript">


							




function enviando(valor)
{

$.post( "componentes/precio.php", { vehiculo: valor}, function (data) {

   $('#precio_hora').val(data.precio_hora);
   $('#id_precio').val(data.id_precio);
 
   
   }, "json" )
   
.done(function( data ) {

});

}



$(document).ready(function() {
	


    $(' #formulario').submit(function() {
        $.ajax({
            type: 'POST',
				dataType: "json",
            url: $(this).attr('action'),
            data: $(this).serialize(),
			beforeSend: function(objeto){
         //   alert("Adiós, me voy a ejecutar");
        },
		error: function(){alert('ocurrio un error !!');},
		complete: function(){$("#formulario").reset();},
		
            success: function(data) {
                $('#resultado').html(data);
								
							if (data.estado_consulta == "exitoso")
					  			{
				
				 		new Messi('se actualizo correctamente.', {title: 'se actualizo', titleClass: 'success', center: true, autoclose: 2000, closeButton: true});
						
								}else{
									new Messi('ocurrio un error en la actualizacion.', {title: 'error', titleClass: 'anim error', center: true, autoclose: 2000, closeButton: true});
									}
				}
			
        }).done(function(data ) {
$('#formulario').each(function(){
  this.reset();
});


});
        
        return false;
    }); 
})  
</script>


</body>
</html>